package com.kunyi.web.service.file.core.transform;

import com.kunyi.web.service.file.entity.domain.ExportRequest;
import com.kunyi.web.service.file.entity.resp.ExportProgressResp;
import com.kunyi.web.serviceapi.file.entity.dto.DataExportDto;

/**
 * @ClassName ExportRequestTransform
 * @Description ExportRequest类转换
 * @Author pengjunjun
 * @Date 2024/03/04
 * @Version 1.0
 **/
public class ExportRequestTransform {
    public static ExportRequest exportDto2Request(DataExportDto dto) {
        return new ExportRequest()
                .setDataUrl(dto.getDataUrl())
                .setNotifyUrl(dto.getNotifyUrl())
                .setParam(dto.getParam())
                .setPageSize(dto.getPageSize())
                .setTotal(dto.getTotal());
    }

    public static ExportProgressResp request2Progress(ExportRequest request) {
        return new ExportProgressResp()
                .setStatus(request.getStatus())
                .setTotal(request.getTotal())
                .setSuccessTotal(request.getSuccessTotal())
                .setRemark(request.getRemark())
                .setFileUrl(request.getFileUrl());
    }
}
